<!DOCTYPE html>
<html>
  <head>
    <title>AutoKitteh - Auth0 - New Connection</title>
    <link
      rel="apple-touch-icon"
      sizes="180x180"
      href="/static/apple-touch-icon.png"
    />
    <link
      rel="icon"
      type="image/png"
      sizes="32x32"
      href="/static/favicon-32x32.png"
    />
    <link
      rel="icon"
      type="image/png"
      sizes="16x16"
      href="/static/favicon-16x16.png"
    />
    <link rel="manifest" href="/static/site.webmanifest" />
    <link rel="stylesheet" type="text/css" href="styles.css" />
    <meta name="robots" content="noindex, nofollow" />
  </head>

  <body>
    <a href="/" target="_self">
      <img class="banner" src="/static/banner.svg" alt="AutoKitteh" />
    </a>

    <table class="title">
      <td><img class="logo" src="/static/images/auth0.svg" alt="Logo" /></td>
      <td>
        <h1>Auth0 - Create a New Connection</h1>
      </td>
    </table>

    <p class="info">Information:</p>
    <ul class="links">
      <li>
        <a
          href="https://docs.autokitteh.com/integrations/auth0/config"
          target="_blank"
          class="info"
        >
          AutoKitteh guide: configuring Auth0 connections
        </a>
      </li>
    </ul>

    <form id="save-form" method="post" action="/auth0/save">
      <input type="hidden" name="auth_type" value="oauth" />

      <div class="form-group">
        <label for="client_id">Client ID</label>
        <input
          type="text"
          id="clientId"
          name="client_id"
          autocomplete="off"
          spellcheck="false"
          required
        />
      </div>

      <div class="form-group">
        <label for="client_secret">Client Secret</label>
        <input
          type="text"
          id="clientSecret" 
          name="client_secret"
          autocomplete="off"
          spellcheck="false"
          required
        />
      </div>

      <div class="form-group">
        <label for="auth0_domain">Auth0 Domain</label>
        <input
          type="text"
          id="auth0Domain"
          name="auth0_domain"
          autocomplete="off"
          spellcheck="false"
          required
        />
      </div>

      <div class="form-group">
        <p class="info">
          Click the button below to install and authorize<br />
          the <strong>AutoKitteh</strong> app in your Auth0 tenant
        </p>
      </div>

      <button type="submit" class="submit-btn">Start OAuth Flow</button>
    </form>


    <script>
      const queryString = window.location.search;
      document
        .getElementById("save-form")
        .setAttribute("action", "/auth0/save" + queryString);
    </script>
  </body>
</html>
